﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;

namespace InversPong.Model
{
    public class Player
    {
        public static readonly int defaultPlayerLives = 4;

        public Keys Up { get; set; }

        public Keys Down { get; set; }

        public String Name { get; set; }

        public int InitialLives { get; set; }

        public int Lives { get; set; }

        public bool Inversed { get; set; }

        public Bat Bat { get; set; }

        public Player(Bat bat, Keys up, Keys down, String name, int lives)
        {
            Bat = bat;
            Up = up;
            Down = down;
            Name = name;
            Lives = Player.defaultPlayerLives;
            InitialLives = Player.defaultPlayerLives;
            Inversed = false;
        }

        public Player(Bat bat, Keys up, Keys down, String name)
            : this(bat, up, down, name, Player.defaultPlayerLives)
        {
            
        }

        public Player(Keys up, Keys down, String name)
            : this(null, up, down, name)
        {

        }

        public bool isAlive()
        {
            return (Lives > 0);
        }

        public void LifeLosed()
        {
            Lives--;
        }
    }
}
